<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改规则要素组')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-group-edit" th:object="${ruleElementsGroup}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">归属机构：</label>
            <div class="col-sm-8">
                <select name="deptId" class="form-control m-b" th:with="type=${@dept.selectDeptListByType('2')}"
                        disabled
                        required>
                    <option th:each="dept : ${type}" th:text="${dept.deptName}" th:value="${dept.deptId}"
                            th:field="*{deptId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">组合编码：</label>
            <div class="col-sm-8">
                <input name="groupCode" th:field="*{groupCode}" class="form-control" required readonly maxlength="20"
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">名称：</label>
            <div class="col-sm-8">
                <input name="groupName" th:field="*{groupName}" class="form-control" required maxlength="30"
                       type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">计算公式：</label>
            <div class="col-sm-8">
                <textarea name="ruleFormulas" class="form-control" style="height: 200px;" required maxlength="500">[[*{ruleFormulas}]]</textarea>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 参照百度QLExpress规则引擎使用介绍</span>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea name="remark" class="form-control" type="text" maxlength="200">[[*{remark}]] </textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "rule/group";
    $("#form-group-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-group-edit').serialize());
        }
    }
</script>
</body>
</html>